#!/usr/bin/bash

VM_NAME=${1?"*** Fedora41"}
VM_PATH=${2?"*** /opt/vm/data/Fedora41.qcow2"}
VM_SIZE=${3?"*** 64"}
VM_ISO=${4?"*** /opt/vm/iso/Fedora-Workstation-Live-x86_64-41-1.4.iso"}
VM_MEM=${5:-"4096"}
VM_VCPUS=${6:-"2"}

[[ $DRY_RUN == "yes" ]] && prefix="echo" || prefix=""

$prefix virt-install \
    --name ${VM_NAME} \
    --os-variant fedora-unknown \
    --ram ${VM_MEM} \
    --vcpus=2 \
    --disk path=${VM_PATH},size=${VM_SIZE} \
    --cdrom ${VM_ISO} \
    --network network=default \
    --graphics vnc,listen=0.0.0.0 \
    --noautoconsole
